#include "mytreeview.h"
#include <QMouseEvent>
#include <QDebug>
MyTreeView::MyTreeView(QWidget *parent) : QTreeView(parent)
{

}

MyTreeView::~MyTreeView()
{

}

QModelIndex MyTreeView::getIndex()
{
    return this->currentIndex();
}

//void MyTreeView::mousePressEvent(QMouseEvent *event)
//{

//    Q_UNUSED(event);
//    QModelIndex index=this->currentIndex();
//    if(index.isValid()){
//        emit sig_clickedDoubel();
//    }
//    qDebug()<<"mousePressEvent"<<index.isValid();
//    QTreeView::mousePressEvent(event);
//}

void MyTreeView::mouseDoubleClickEvent(QMouseEvent *event)
{
    Q_UNUSED(event);
    QModelIndex index=this->currentIndex();
    if(index.isValid()){
        emit sig_clickedDoubel();
    }
    QTreeView::mouseDoubleClickEvent(event);
}

